home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
comm
/
pirch32.zip
/
HANGMAN.PIL
< prev
next >
Wrap
Text File
|
1996-07-22
|
1KB
|
32 lines
{
-Usage /runscript [HANGMAN] <Game word or phrase>
-Required event: ON TEXT:!hangman*:#:/runscript [hangplay] # $nick *2
-Required event: ON TEXT:!solve*:#:/runscript [hangsolve] # $nick *2
-This is a IRC HANGMAN game written to demonstrate PIL scripting.
-This is a multi-script game....
-[HANGMAN] (this script) starts a new game
-[HANGPLAY] Processes the user guess at a letter
-[HANGSOLVE] Processes a user guess at the entire word or phrase
-HANGMAN in case you dont remember is a word game in which one person
-(the controller of the game ie YOU) makes up a word and allows others
-to guess letters. If the letter is in the word, the letter is filled in, if the letter is
-not in the word, part of hangman is drawn... play continues until the word/phrase
- is guessed or all of hangman is drawn (in which case he is hung)
-(our hangman only has 4 parts)
}
$hmword := *1;
$hmword := strlower($hmword);
command('/define hangword=',$hmword);
$hmsolved := '';
for i := 1 to strlen($hmword) do
begin
if strcopy($hmword,i,1) <> ' ' then
$hmsolved := $hmsolved + '-'
else
$hmsolved := $hmsolved + ' ';
end;
command('/define hangsolved=',$hmsolved);
command('/define hangmissed=',0);
command('/msg ',$audience,' ',\3,' Hangman Game has started: type !hangman <letter> to make a guess ',\3);
command('/msg ',$audience,' ',\3,' Hangman: ',$hmsolved,\3);